<%@ page language="java" import="java.util.*,com.hs.core.utils.*,java.net.*,com.hs.app.action.search.*" pageEncoding="utf-8"%>
<%
 String allsql = (String)request.getAttribute("allsql");

String pageStr = (String)request.getAttribute("pagestr");
List datalist = (List)request.getAttribute("datalist");
StringBuffer catagorystr = new StringBuffer();
StringBuffer catavaluestr = new StringBuffer();

  
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<head> 
<%@ include file="../../include.jsp"%> 
<script src='<%=basePath%>thirtpart/jquery/jquery.blockUI.js'></script> 
<script src='<%=basePath%>app/js/hs.search.js'></script> 
<script language="javascript" type="text/javascript" src="<%=path %>/thirtpart/highcharts216/highcharts.js"></script>
<script language="javascript" type="text/javascript" src="<%=path %>/thirtpart/highcharts216/modules/exporting.js"></script>
<style>.tac{text-align:center}</style>
<script type="text/javascript">
function changgeUrl(url){ 
 	dataform.action=url;
 	dataform.submit();
}
  

</script>
<body>
<div class="cont">
<!--检索--> 
        <div class="sear_tab">
            <div class="tab1">
               
                <span><a href="javaScript:changgeUrl('<%=basePath %>stat/prestat.do');" style="TEXT-DECORATION:none;">方剂统计</a></span>
                <span class="curr"><a href="javaScript:changgeUrl('<%=basePath %>stat/disstat.do');" style="TEXT-DECORATION:none;">证候统计</a></span>
                <span><a href="javaScript:changgeUrl('<%=basePath %>stat/herbstat.do');" style="TEXT-DECORATION:none;">中药统计</a></span>
                
                <span><a href="javaScript:changgeUrl('<%=basePath %>stat/westmedstat.do');" style="TEXT-DECORATION:none;">西药统计</a></span>
                <span><a href="javaScript:changgeUrl('<%=basePath %>stat/pointstat.do');" style="TEXT-DECORATION:none;">穴位统计</a></span>
               
            </div> 
       </div>
       <form name="dataform" action="" method="post">
               <input type="hidden"  value="<%=allsql==null?"":allsql %>" name="allsql" id="allsql"/>  
       
       </form>
    <!--/检索--> 
    <div class="iframeWrap1" id="iframedata">
     <table border="0" cellpadding="0" cellspacing="0" style="margin-bottom:0" class="sear"> 
   <tr>
     <td class="tar"> 
       <div id="container"></div> 
      </td>
   </tr>
 
</table>
    <div class="listWrap">
       <table border="0" cellpadding="0" cellspacing="0" class="tableList">
      <tr> 
          <th width="15%" align=center>序号</th>
          <th width="*">证候名称</th> 
          <th width="20%">总数量</th>   
      </tr> 
      <%if(datalist != null && datalist.size()>0){
    	  int count = datalist.size();
    	  int imagecount = 0;
    	  for(int i = 0;i<count;i++){
    	     Map data = (Map)datalist.get(i);
    	     String fm = (String)data.get("fjmc");
    	     String countnum = data.get("countnum")+"";
    	     imagecount++;
    	     if(imagecount <=20){
	    	     catagorystr.append("'").append(fm.trim()).append("'");
	    	     catavaluestr.append(countnum);
	    	     if(i != count-1 && imagecount!= 20){
	    	    	 catagorystr.append(",");
	    	    	 catavaluestr.append(",");
	    	     }
    	     }%>
    	     <tr> 
             <td align=center><%=i+1 %></td>
             <td><a href="#"><%=fm %></a></td> 
             <td align=center><%=countnum %></td>   
         </tr> 
    	 <%}}else{%> 
        <tr>
          <td colspan=3 align="center"><font color=red><strong>没有相关的疾病、证候数据！</strong></font></td>
        </tr> 
        <%} %>
    </table> 
    </div>
    <div class="pageWrap">
        <div class="result"></div>
        <div class="page"> 
        </div>
    </div>
    </div>
</div> 
</body>
</html>
<script type="text/javascript">
var chart;
$(document).ready(function() {
	chart = new Highcharts.Chart({
		chart: {
			renderTo: 'container',
			defaultSeriesType: 'column',
			margin: [ 50, 50, 100, 80]
		},
		title: {
			text: '临床库相关证候统计',
				style: {
					 font: 'normal 20px bold Verdana, sans-serif'
				}
		},
		xAxis: {
			categories: [<%=catagorystr%>],
			labels: {
				rotation: -45,
				align: 'right',
				style: {
					 font: 'normal 13px Verdana, sans-serif'
				}
			}
		},
		yAxis: {
			min: 0,
			title: {
				text: '累计数量'
			}
		},
		legend: {
			enabled: false
		},
		tooltip: {
			formatter: function() {
				return '<b>'+ this.x +'</b><br/>'+
					 '累计数量: '+ Highcharts.numberFormat(this.y, 1) +
					 ' 次';
			}
		},
	        series: [{
			name: '累计数量',
			data: [<%=catavaluestr%>],
			dataLabels: {
				enabled: true,
				rotation: -90,
				color: '#FFFFFF',
				align: 'right',
				x: -3,
				y: 10,
				formatter: function() {
					return this.y;
				},
				style: {
					font: 'normal 13px Verdana, sans-serif'
				}
			}			
		}]
	});
	
	
}); 
	</script> 
